# !/usr/bin/env python
# coding: utf-8
# @Time    : 2017/11/6 14:57
# @Author  : 6imensiva
# @Site    : https://gitee.com/dimensiva/app_server.git
# @File    : my_string.py
# @Software: PyCharm
# @Version: 3.5.4

import uuid
import re


def get_uuid_by_timestamp():
	return str(uuid.uuid4())


get_uuid_by_timestamp2 = lambda x:str(uuid.uuid4())


def get_random_string(n):
	return str(uuid.uuid1()).replace('-', '')[:n]


def check_mobile(mobile):
	p = re.compile("^((13[0-9])|(15[^4,\\D])|(17[0-9])|(18[0-9]))\\d{8}$")
	ret = p.match(mobile)
	if ret:
		return True
	else:
		return False


def check_string(str):
	if str is None or len(str) == 0:
		return False
	else:
		return True


if __name__ == '__main__':
	# print(str(uuid.uuid1()))
	# print(get_random_string(12))
	# for i in range(0, 100):
	# 	print(get_uuid_by_timestamp2(4))
	aaa= {'的风格的风格':'当时感到反感'}
	import json
	print(json.dumps(aaa, ensure_ascii=False).encode())
	from utils import my_file
	aaa = my_file.load_json_file('../resource/menu.json')
	# from utils import my_json
	# f= open('../resource/menu.json', 'r')
	# aaa = my_json.json_load_byteified(f)
	print(aaa)

